<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="__LAYUI__/css/layui.css">
    <style type="text/css">

        .container{
            width: 420px;
            height: 320px;
            min-height: 320px;
            max-height: 320px;
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            margin: 150px auto;
            padding: 20px;
            z-index: 130;
            border-radius: 8px;
            box-shadow: 0 1px 6px #000000;
            font-size: 16px;
        }
        .close{
            background-color: white;
            border: none;
            font-size: 18px;
            margin-left: 410px;
            margin-top: -10px;
        }

        .layui-input{
            border-radius: 5px;
            width: 300px;
            height: 40px;
            font-size: 15px;
        }
        .layui-form-item{
            margin-left: -20px;
        }
        #logoid{
            margin-top: -16px;
            padding-left:150px;
            padding-bottom: 15px;
        }
        .layui-btn{
            margin-left: -50px;
            border-radius: 5px;
            width: 350px;
            height: 40px;
            font-size: 15px;
        }
        .verity{
            width: 100%;
        }
        .font-set{
            font-size: 13px;
            text-decoration: none;
            margin-left: 120px;
        }
        a:hover{
            text-decoration: underline;
        }
        .j-font-color{
            color: #ffffff!important;
        }
    </style>
</head>
<body  style="background-image:url(/static/common/img/admin/background.png);background-repeat: no-repeat;background-size:100vw 100vh;">
<form class="layui-form" action="" method="post">
    <div class="container">
        <div class="layui-form-mid layui-word-aux j-font-color" style="text-align: center!important;float: none!important;">
            <h2>欢迎来到{:config('base.web_site_title')}</h2>
            <br>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label j-font-color">用户名</label>
            <div class="layui-input-block">
                <input type="text" name="account" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label j-font-color">密 &nbsp;&nbsp;码</label>
            <div class="layui-input-block">
                <input type="password" name="passwd" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
<!--             <div class="layui-form-mid layui-word-aux">辅助文字</div>-->
        </div>
        <div class="layui-form-item" >
            <label class="layui-form-label j-font-color">验证码</label>
                <div class="layui-input-inline" style="width: 35%!important;">
                    <input type="text" name="captcha" required  lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input verity">
                </div>
                <div class="layui-input-inline" style="width: 30%!important;">
                    <img src="{:captcha_src()}" alt="验证码" width="100%" height="40px" onclick="javascript:this.src=this.src+'?'+Math.random();" id="captcha">
                </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="login">登陆</button>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript" src="__LAYUI__/layui.js"></script>
<script>
    layui.use(['form', 'layer','jquery'], function(){
        var form = layui.form
            ,layer = layui.layer
            , $ = layui.jquery;

        form.render();

        //监听提交
        form.on('submit(login)', function(data){
            console.log(data);
            $.post('login',data.field,function(res){
                if(res.code == 1){
                    layer.msg('登录成功');
                    setTimeout(function(){
                        parent.location.href=res.url;
                    },500)
                }else{
                    layer.msg(res.msg);
                    $('#captcha').attr('src',$('#captcha').attr('src')+Math.random());
                }
            },'json');
            return false;
        });


    });
</script>
</body>
</html>